'use strict';

module.exports = (app) => {
    const {DataTypes} = app.Sequelize;
    const Company = app.model.define('company', {
        id: { 
            type: DataTypes.UUID,
            defaultValue: app.Sequelize.UUIDV4, 
            primaryKey: true,
            notNull: true,
            comment: 'ID'
        },
        address:{type: DataTypes.STRING(50),notNull:true,comment: 'banner'},
        name:{type: DataTypes.STRING(50),notNull:true,comment: 'banner'},
        contact:{type: DataTypes.STRING(50),notNull:true,comment: 'banner'},
        email:{type: DataTypes.STRING(50),notNull:true,comment: 'banner'},
        logo:{type: DataTypes.STRING(200),notNull:true,comment: 'banner'},
        banner:{type: DataTypes.STRING(200),comment: 'banner'},
        lon:{type: DataTypes.STRING(100),comment: '经度'},
        lat:{type: DataTypes.STRING(100),comment: '纬度'},
        position:{type:DataTypes.INTEGER}
    },
  );
  Company.sync()
  return Company;
};